package main

import (
	"fmt"
	"os"
	"os/exec"
)

func main() {
	maven, errs := exec.LookPath("mvn")
	print(maven)
	if errs != nil {
		fmt.Println(errs)
	}
	cmd := exec.Command(maven, "clean", "install")
	cmd.Dir = "/home/luxian/code/demo"

	testlog, err := os.Create("./test.log")
	if err != nil {
		fmt.Print(err)
	}
	cmd.Stdout = testlog
	cmd.Stderr = testlog

	err = cmd.Run()
	if err != nil {
		fmt.Print(err)
	}

}
